alter table jms_dm.dm_tab_day_recevie_total_dt set tblproperties ('external.table.purge'='true');
drop table if exists jms_dm.dm_tab_day_recevie_total_dt;
create external table if not exists jms_dm.dm_tab_day_recevie_total_dt(
    pre_network_code string comment'上一机构编码'
    ,pre_network_name string comment'上一机构'
    ,recevie_network_code string comment'接件机构编码'
    ,recevie_network_name string comment'接件机构'
    ,recevie_agent_name string comment'代理区'
    ,recevie_agent_code string comment'代理区编码'
    ,recevie_fran_name string comment'加盟商'
    ,recevie_fran_code string comment'加盟商编码'
    ,total_num bigint comment'应接件票数'
    ,intime_total bigint comment'准点接件票数'
    ,not_intime_total bigint comment'不准点接件票数'
    ,rate decimal(10,4) comment'准点率'
    ,load_scan_date string COMMENT '装车发件日期'
) comment '接件准点率明细'
PARTITIONED BY (dt string comment'分区字段-实际接件时间')
STORED AS PARQUET
LOCATION '/dw/hive/jms_dm.db/external/dm_tab_day_recevie_total_dt'
TBLPROPERTIES (
    'discover.partitions' = 'false',
    'parquet.column.index.access' = 'true'
);

alter table jms_dm.dm_tab_day_recevie_detail_dt set tblproperties ('external.table.purge'='true');
drop table if exists jms_dm.dm_tab_day_recevie_detail_dt;
create external table if not exists jms_dm.dm_tab_day_recevie_detail_dt(
    billcode string comment'运单'
    ,shipment_no string comment'任务号'
    ,pre_network_code string comment'上一机构编码'
    ,pre_network_name string comment'上一机构'
    ,recevie_network_code string comment'接件机构编码'
    ,recevie_network_name string comment'接件机构'
    ,recevie_agent_name string comment'代理区'
    ,recevie_agent_code string comment'代理区编码'
    ,recevie_fran_name string comment'加盟商'
    ,recevie_fran_code string comment'加盟商编码'
    ,filter_type tinyint comment'问题件标记 1-问题件 2-非问题件'
    ,real_recevie_date timestamp comment'实际接件时间'
    ,plan_recevie_date timestamp comment'规划接件时间'
    ,is_in_time tinyint comment'是否准点 1-准点 0-不准点'
    ,pre_arr_date timestamp comment'上一站到件时间'
    ,scan_time timestamp comment'装车扫描日期'
) comment '接件准点率明细'
PARTITIONED BY (dt string comment'分区字段-实际接件时间')
STORED AS PARQUET
LOCATION '/dw/hive/jms_dm.db/external/dm_tab_day_recevie_detail_dt'
TBLPROPERTIES (
    'discover.partitions' = 'false',
    'parquet.column.index.access' = 'true'
);